Repository navigation
fix(id/groups): GroupLog::open drops and truncates a torn final fragment (#1522) - #2924
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 26 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1522.
GroupLog::openparsed every line withserde_json::from_str(...)?, so a crash-torn unterminated final fragment ingroups.jsonl— exactly what its own single-write_allappend can leave behind — bricked every group command.Mirror the sibling stores (
Outbox::open, and the world journal'sFileJournal::open):split_inclusive('\n')and track the byte count of kept lines.tracing::warn!, like the world journal), drop it, and truncate the file to the last complete line so the next append is not glued onto the fragment.line N is not an eventcontext — the existingtest_a_line_that_is_not_an_event_is_an_errorpasses unchanged.Tests (laptop,
cargo test groups::log): 6/6 pass — the 4 pre-existing tests plus:test_a_torn_final_fragment_is_dropped_and_truncated— a fragment-only log opens empty and the file is truncated to empty.test_a_torn_fragment_after_valid_events_keeps_them_and_folds— valid events survive,projection()folds and contains the created group, and the file is truncated back to the good bytes.Full groups module on the laptop:
cargo test --lib groups::— 443 passed, 0 failed.Queue task 1800 (triage pinned by task 1567).
Need help on this PR? Tag
@codesmith-botwith what you need.